<template>
    <view class="page">
        <view class="tab">
            <view class="tab_1" @click="toList">
                <view><text style="font-size: 36rpx;">设</text>备管理</view>
            </view>
            <view class="tab_1" @click="toUserList">
                <view><text style="font-size: 36rpx;">商</text>家管理</view>
            </view>
            <view class="tab_1" @click="toUserList" v-if="false">
                <view><text style="font-size: 36rpx;">报</text>表中心</view>
            </view>

        </view>
        <view class="outLogin" @click="outLogin">退出登录</view>
    </view>
</template>

<script>
export default {
    components: {},
    props: {},
    data() {
        return {
            type: ''
        };
    },
    watch: {},
    methods: {
        toList() {
            uni.navigateTo({ url: '/pages/manufacturerPage/list' })
        },
        toUserList() {
            uni.navigateTo({ url: '/pages/manufacturerPage/userList' })
        },
        outLogin() {
            uni.showModal({
                title: '提示',
                content: '确认退出账号吗?',
                showCancel: true,
                success: ({ confirm, cancel }) => {
                    if (confirm) {
                        uni.clearStorageSync()
                        uni.reLaunch({ url: '/pages/index/index' })
                    }
                }
            })
        }
        // to(index) {
        //     switch (index) {
        //         case 1:
        //             uni.navigateTo({ url: '/pages/manufacturer/merchantList' })
        //             break;
        //         case 2:
        //             uni.navigateTo({ url: '/pages/manufacturer/cartList' })
        //             break;
        //         case 3:
        //             uni.navigateTo({ url: '/pages/manufacturer/userList' })
        //             break;
        //         case 4:
        //             uni.showModal({
        //                 title: '提示',
        //                 content: '确认退出账号吗?',
        //                 showCancel: true,
        //                 success: ({ confirm, cancel }) => {
        //                     if (confirm) {
        //                         uni.clearStorageSync()
        //                         uni.reLaunch({ url: '/pages/index/index' })
        //                     }
        //                 }
        //             })
        //             break;
        //     }
        // }
    },
    onShow() { },
    onLoad(option) {
        console.log(option)
        switch (Number(option.type)) {
            case 5:
                uni.setNavigationBarTitle({ title: '厂家' })
                break;
            case 4:
                uni.setNavigationBarTitle({ title: '商户' })
                break;
            case 3:
                uni.setNavigationBarTitle({ title: '车队队长' })
                break;
            case 2:
                uni.setNavigationBarTitle({ title: '运输车车主' })
                break;
            case 2:
                uni.setNavigationBarTitle({ title: '普通会员' })
                break;
        }
    },
};
</script>
<style scoped lang='scss'>
.page {
    background-color: #efefef;
    width: 100%;
    min-height: 100vh;
}


.tab {
    width: 100%;
    min-height: 300rpx;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    margin-top: 10rpx;
    padding-bottom: 20rpx;

    .tab_1 {
        width: 45%;
        background-color: $uni-color-primary;
        height: 160rpx;
        margin: auto;
        border-radius: 20rpx;
        text-align: center;
        color: #Fff;
        line-height: 160rpx;
    }

    .tab_1:nth-child(3) {
        margin-left: 20rpx;
        margin-top: 30rpx;
    }

}

.outLogin {
    background: $uni-color-primary;
    border-radius: 8px 8px 8px 8px;
    width: 90%;
    height: 80rpx;
    margin: auto;
    margin-top: 120rpx;
    color: #fff;
    text-align: center;
    line-height: 80rpx;
    position: fixed;
    bottom: 120rpx;
    left: 5%;
}
</style>